import {createApp} from 'vue'
import App from './App.vue'
import "./style"
import "./assets/iconfont/iconfont.js"
import commonVue from './mixin/common.vue'
import router, {setupRouter} from "@/router"
import { setupStore } from '@/store';
import naive from 'naive-ui'
import { AppProvider } from '@/components/Application';
async function Start() {
    const appProvider = createApp(AppProvider);
    const app = createApp(App);
    // 混入设置
    app.mixin(
        commonVue
    )
    // app.use(BaseComponents)
    app.use(naive)
    // 状态管理设置
    setupStore(app)
    //优先挂载一下 Provider 解决路由守卫，Axios中可使用，Dialog，Message 等之类组件
    appProvider.mount('#appProvider', true);
    // 路由设置
    await setupRouter(app)
    // 路由准备就绪后挂载APP实例
    await router.isReady();
    app.mount('#app',true);
}

Start()
